//
//  SuitableHeight.m
//  BTRIP
//
//  Created by johnbk on 15/11/14.
//  Copyright © 2015年 johnbk. All rights reserved.
//

#import "SuitableHeight.h"

@implementation SuitableHeight
+(CGFloat)suitableHeight:(NSString *)text andWidth:(CGFloat)width andFont:(CGFloat)fontSize{
	
	CGSize size = CGSizeMake(width, MAXFLOAT);
	NSDictionary *dic = [NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:fontSize] forKey:NSFontAttributeName];
	
	CGRect frame = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
	return frame.size.height;
	
}
@end
